<?php

namespace app\admin\validate;

use think\Validate;

/**
 * 区域字典信息验证器
 * Created by PhpStorm.
 * User: tyll
 * Date: 2019/09/24
 * Time: 15:04
 */
class RegionDict extends Validate
{
    protected $rule = [
        'name'     => 'require',
        'sort'     => 'require|integer|egt:0',
        'is_cp_ws' => 'require'
    ];

    protected $message = [
        'name.require'     => '区域名称必须填写',
        'sort.require'     => '顺序必须填写',
        'sort.integer'     => '顺序填写错误',
        'sort.egt'         => '顺序必须错误',
        'is_cp_ws.require' => '是否巡店工位必须填写'
    ];

    protected $scene = [
        'add'  => ['name', 'sort', 'is_cp_ws'],
        'edit' => ['name', 'sort', 'is_cp_ws']
    ];
}
